package com.yuba.front.mapper;

import com.yuba.common.ai.domain.VectorData;
import com.yuba.common.mybatis.core.mapper.BaseMapperPlus;
import com.yuba.front.domain.Articles;
import com.yuba.front.domain.vo.ArticlesVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 钓鱼知识库Mapper接口
 *
 * @author modakai
 * @date 2024-12-13
 */
public interface ArticlesMapper extends BaseMapperPlus<Articles, ArticlesVo> {

    /**
     *
     * @return
     */
    List<ArticlesVo> selectHotList(@Param("categoryCode") String categoryCode);

    @Select("""
                        select article_id as id, articles.title, articles.content, sys_dict_data.dict_label as category_label
                        from articles
                            left join sys_dict_data on sys_dict_data.dict_value = articles.category_code
                        where articles.vector_sync_flag = 'N'
            """)
    List<VectorData> selectVoSync();

}
